home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
net
/
AmiPOP116.lha
/
AmiPOP116
/
source
/
pop_temp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-23
|
4KB
|
211 lines
/* This file contains empty template routines that
* the IDCMP handler will call uppon. Fill out these
* routines with your code or use them as a reference
* to create your program.
*/
#include "pop.h"
int MYGAD_USERClicked( void )
{
/* routine when gadget "_Username" is clicked. */
return(0);
}
int MYGAD_PASSWORDClicked( void )
{
/* routine when gadget "_Password" is clicked. */
return(0);
}
int MYGAD_DELETEClicked( void )
{
/* routine when gadget "_Delete Mail" is clicked. */
delmail= (!delmail);
return(0);
}
int MYGAD_MAILBOXClicked( void )
{
/* routine when gadget "Mail _Box" is clicked. */
strcpy(mailbox,GetString(Project0Gadgets[GD_MYGAD_MAILBOX]));
closecx();
strcpy(username,GetString(Project0Gadgets[GD_MYGAD_USER]));
setupcx();
return(0);
}
int MYGAD_BUTTONClicked( void )
{
/* routine when gadget "_Check Now" is clicked. */
struct Requester *BusyRequester;
if (Project0Wnd)
{
if (BusyRequester=AllocVec(sizeof(struct Requester),MEMF_CLEAR))
{
Request(BusyRequester,Project0Wnd);
SetPointer(Project0Wnd, waitPointer, 16, 16, -6, 0);
}
}
if (dopop())
{
doreq("An error has occured.",bum);
}
if (Project0Wnd)
{
ClearPointer(Project0Wnd);
EndRequest(BusyRequester,Project0Wnd);
FreeVec(BusyRequester);
}
return(0);
}
int MYGAD_HOSTClicked( void )
{
/* routine when gadget "POP _Host" is clicked. */
strcpy(pophost,GetString(Project0Gadgets[GD_MYGAD_HOST]));
return(0);
}
int MYGAD_TIMEClicked( void )
{
/* routine when gadget "How _Often" is clicked. */
AbortIO( (struct IORequest *)timerio);
WaitIO( (struct IORequest *)timerio);
Wait( 1L << timer_mp->mp_SigBit );
timecheck=(int)GetNumber(Project0Gadgets[GD_MYGAD_TIME]);
timereq();
return(0);
}
int MYGAD_CRONCHECKClicked( void )
{
/* routine when gadget "Check _Periodically" is clicked. */
checkper= (!checkper);
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_TIME], Project0Wnd, NULL, GA_Disabled, !checkper,TAG_END);
return(0);
}
int MYGAD_APPENDClicked( void )
{
/* routine when gadget "_Append to MailBox?" is clicked. */
appfile= (!appfile);
return(0);
}
int Project0MENU_HIDE( void )
{
/* routine when (sub)item "Hide" is selected. */
closedown();
return(TRUE);
}
int Project0MENU_ABOUT( void )
{
/* routine when (sub)item "About..." is selected. */
doreq("AmiPOP - A POP3 Client\nBy Scott Ellis","Wow");
return(TRUE);
}
int Project0MENU_QUIT( void )
{
/* routine when (sub)item "Quit" is selected. */
return(FALSE);
}
int Project0CloseWindow( void )
{
/* routine for "IDCMP_CLOSEWINDOW". */
closedown();
return(TRUE);
}
int Project0VanillaKey( void )
{
/* routine for "IDCMP_VANILLAKEY". */
UWORD imsgCode;
imsgCode=Project0Msg.Code;
switch(imsgCode)
{
case 'p':
case 'P':
ActivateGadget(Project0Gadgets[GD_MYGAD_HOST], Project0Wnd,NULL);
break;
case 'u':
case 'U':
ActivateGadget(Project0Gadgets[GD_MYGAD_USER], Project0Wnd,NULL);
break;
case 'w':
case 'W':
ActivateGadget(Project0Gadgets[GD_MYGAD_PASSWORD], Project0Wnd,NULL);
break;
case 'b':
case 'B':
ActivateGadget(Project0Gadgets[GD_MYGAD_MAILBOX], Project0Wnd,NULL);
break;
case 'o':
case 'O':
if (checkper)
{
ActivateGadget(Project0Gadgets[GD_MYGAD_TIME], Project0Wnd,NULL);
}
break;
case 'n':
case 'N':
MYGAD_BUTTONClicked();
break;
case 'c':
case 'C':
MYGAD_CRONCHECKClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_CRONCHECK], Project0Wnd, NULL, GTCB_Checked, checkper,TAG_END);
break;
case 'd':
case 'D':
MYGAD_DELETEClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_DELETE], Project0Wnd, NULL, GTCB_Checked, delmail,TAG_END);
break;
case 'a':
case 'A':
MYGAD_APPENDClicked();
GT_SetGadgetAttrs(Project0Gadgets[GD_MYGAD_APPEND], Project0Wnd, NULL, GTCB_Checked, appfile,TAG_END);
break;
}
return(0);
}
int Project0ChangeWindow( void )
{
/* routine for "IDCMP_CHANGEWINDOW". */
return(0);
}